/**
 * @file echoarg.c
 * @author liangwenhao (1943080020@qq.com)
 * @brief 
 * @version 0.1
 * @date 2021-07-21
 * 
 * @copyright Copyright (c) 2021
 * 
 * @authorGitee  https://gitee.com/liangwenhao
 * @authorGithub https://github.com/WHaoL
 * @authorBlogs https://blog.csdn.net/liangwenhao1108
 *  
 * @Code Description: 测试输出argv中的所有字符串  参数  P162
 *  
 */
#include "apue.h"

int main(int argc, char *argv[])
{
    int i;
    for (i = 0; i < argc; i++) // 输出所有命令行参数
        printf("argv[%d]: %s\n", i, argv[i]);

    for (i = 0; argv[i] != NULL; i++) // argv[argc]是一个空指针
        printf("argv[%d]: %s\n", i, argv[i]);

    exit(0);
}